Skip to content

gh-150831: clarify generator, generator function, and generator iterator in glossary#150905

Open
Aniketsy wants to merge 4 commits into
python:mainfrom
Aniketsy:fix-150831
Open

gh-150831: clarify generator, generator function, and generator iterator in glossary#150905
Aniketsy wants to merge 4 commits into
python:mainfrom
Aniketsy:fix-150831

Conversation

@Aniketsy
Copy link
Copy Markdown
Contributor

@Aniketsy Aniketsy commented Jun 4, 2026

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Jun 4, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #33016547 | 📁 Comparing c5a8f8d against main (cb064e7)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

@nedbat
Copy link
Copy Markdown
Member

nedbat commented Jun 5, 2026

I would love to move the glossary closer to actual usage. I have never heard someone say "generator iterator": it's redundant. Can we explicitly mention that "generator" is used informally for both meanings and that "generator function" and "generator iterator" are formal terms that are uncommon?

@Aniketsy
Copy link
Copy Markdown
Contributor Author

Aniketsy commented Jun 5, 2026

Can we explicitly mention that "generator" is used informally for both meanings and that "generator function" and "generator iterator" are formal terms that are uncommon?

hmm , i think its good to mention like this. thanks for the improvement 😊

Comment thread Doc/glossary.rst Outdated
Comment thread Doc/glossary.rst Outdated
Generator iterators also implement the :meth:`~generator.send` method
to send a value into the suspended generator, and the
:meth:`~generator.throw` method to raise an exception at the point
where the generator was paused. See :pep:`342`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's find a reference in the docs to explain this instead of a PEP.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:ref:`generator-methods`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the reference 😊 .

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Comment thread Doc/glossary.rst Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Glossary terms for generators might mismatch usage in the community and are inconsistent with coroutines

2 participants